import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;

public class Main {

	public static void main(String[] args) {
		ArrayList<Student> students = new ArrayList<>();
		for (int i = 0; i < 10; i++) {
			Student s = new Student();
			s.setName("fsfs" + i);
			s.setAge("45");
			s.setSex("male");

			students.add(s);
		}

		String json = JSON.toJSONString(students);
		System.out.println(json);

		List<Student> ss = JSONArray.parseArray(json, Student.class);
		System.out.println(ss);
	}
}
